feat: add normalize/paths/config CLI surface#33
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The 0.6.0 speech-normalization feature shipped the
stackvox.textlibrary but not the CLI surface the design doc promised (docs/speech-normalization.md§4/§7), sonormalize_for_speechwas reachable only via a Pythonimport. This exposes it — plus two other import-only surfaces (paths,config) — from the shell, so consumers likespeaklastcan normalize text without importing stackvox.Changes
stackvox normalize— prints speech-normalized prose (Markdown → speakable text) to stdout; reads--file/positional/stdin. Model-free, so it stays shell-fast.--normalizeonspeak/say(off by default → backward-compatible) normalizes before synth/daemon.normalize_for_speech:--no-markdown,--no-expand-units,--no-expand-numbers,--no-pauses,--tables {drop,csv},--strip-emoji,--no-terminal-stops,--locale, and--pronunciations FILE(a JSON{"written":"spoken"}map). A malformed pronunciations file fails with a clean[stackvox] …message, not a traceback.stackvox paths(cache / socket / pid) andstackvox config(resolved voice/speed/lang + config path).--tables/--localevalue completion,--pronunciationsfile completion).paths/configin the CLI list; 12 new tests.Testing
ruff check .andruff format --check .clean;mypyclean (18 files);pytest— 177 passed.printf '**1,198.9** MPG at £1.63' | stackvox normalize→1198 point 9 miles per gallon at 1 point 6 3 pounds.--tables csvrenders tables comma-separated;--pronunciationsapplies whole-word substitutions; bad JSON exits 1 with a clean message.stackvox paths/stackvox configprint resolved values; the emitted completion script passesbash -n.Related issues
Refs the 0.6.0 speech-normalization design (
docs/speech-normalization.md§4/§7 — the CLI half that wasn't built).CHANGELOG.mdintentionally untouched (release-please owns it); lands in the nextfeatrelease (0.7.0).